import { Column, Entity, PrimaryGeneratedColumn } from "typeorm";

@Entity("rrz_channeltype", { schema: "rrzcms" })
export class RrzChanneltype {
  @PrimaryGeneratedColumn({
    type: "int",
    name: "id",
    comment: "表ID",
    unsigned: true,
  })
  id: number;

  @Column("varchar", { name: "title", comment: "名称", length: 50 })
  title: string;

  @Column("enum", {
    name: "type",
    comment: "类型（articles：文章，goods：产品）",
    enum: ["articles", "goods"],
    default: () => "'articles'",
  })
  type: "articles" | "goods";

  @Column("int", {
    name: "add_time",
    nullable: true,
    comment: "新增时间",
    unsigned: true,
    default: () => "'0'",
  })
  addTime: number | null;

  @Column("int", {
    name: "update_time",
    nullable: true,
    comment: "更新时间",
    unsigned: true,
    default: () => "'0'",
  })
  updateTime: number | null;
}
